<?php
/**
 * Hello View for Hello World Component
 * 
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4
 * @license		GNU/GPL
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );

/**
 * Hello View
 *
 * @package    Joomla.Tutorials
 * @subpackage Components
 */

#class test {
#	public $id;
#	public $detail_name;
#	
#	function __construct($id, $detail_name) {
#       $this->id = $id;
#	   $this->detail_name = $detail_name;
#    }
#}
 
class TargetsViewDetails1 extends JView {
	function display($tpl = null)
	{
		$header = & $this->get('Header');
		
		#$f = fopen ('/tmp/test.txt', 'w+');
		#fwrite($f, $header);
		#fclose($f);
		
		
		JToolBarHelper::title(   JText::_( $header ), 'generic.png' );
		JToolBarHelper::deleteList();
		JToolBarHelper::editListX();
		JToolBarHelper::addNewX();

		// Get data from the model
		$items		= & $this->get('Data');

		#$items = array(
		#	new test(1, 'test1'),
		#	new test(2, 'test2')
		#);
		
		$this->assignRef('items', $items);
		
		$type_id   = JRequest::getInt( 'type_id');
		$target_id = JRequest::getInt( 'target_id');
		
		
		
		
		$this->assignRef('type_id',   $type_id);
		$this->assignRef('target_id', $target_id);
		
		$header2 = & $this->get('Header2');
		
		$this->assignRef('header2', $header2);

		parent::display($tpl);
	}
}